<?php
session_start();
?>


<?php
$username = $_SESSION['username'];
if($username==null || $username== ""|| $username == "")
{
	header('Location: http://172.26.195.159/checklist/php/logout.php');
}

$con = mysql_connect("localhost","root","");
mysql_select_db("checklist", $con);
//check for the CR ID with the person logged in.

$check = "select * from notification";
$result = mysql_query($check);
$num_rows = mysql_num_rows($result);

if($num_rows == FALSE)
{
echo '<script type="text/javascript">','alert("Sorry , No data in notifications.");',
'window.location = "http://172.26.195.159/checklist/php/welcome.php";' ,'</script>';
}
?>


<html>

<head>
<title>
Administration
</title>
</head>

<body>

<a href="welcome.php"> Home</a>
&nbsp;
<a href="logout.php"> Logout</a>
<!-- Adding code -->

<?php

echo "<table>";
for($j=0;$j<$num_rows; $j++)
{
mysql_data_seek($result , $j);
$data = mysql_fetch_assoc($result);

echo "<tr><td><textarea disabled='true'>".$data['type']."</textarea></td>";
echo "<td><textarea>".$data['content']."</textarea></td>";
echo "<td><textarea disabled='true'>".$data['filed_date']."</textarea></td></tr>"; 
}

echo "</table>";
?>

</body>

</html>